package com.ruoyi.system.domain.vo;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import static com.ruoyi.common.constant.UserConstants.QuestionCode.*;

public class QuaStatisticsVo {

    @Data
    public static class Result{
        private Long id;
        private Byte sex;
        private Integer age;
        private String idCard;
        private Date ryrq;
    }

    @Data
    public static class NumResult{
        private Integer year;
        private Integer child;
        private Integer total;
        private  String period;
    }

    @Data
    public static class SexResult{
        private Integer year;
        private Integer child;
        private Integer total;
        private Byte sex;
        private  String period;
        @ApiModelProperty("0-19")
        private int num1 = 0;
        @ApiModelProperty("20-39")
        private int num2 = 0;
        @ApiModelProperty("40-59")
        private int num3 = 0;
        @ApiModelProperty("60-79")
        private int num4 = 0;
    }

    @Data
    @ApiModel("QuaStatisticsVo - JmrsResult")
    public static class JmrsResult {
        //        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date time;
        private int gailv;
        private int total;
        private String date;

        public BigDecimal getDecimal() {
            if (total != 0) {
                BigDecimal divide = new BigDecimal(gailv).divide(new BigDecimal(total), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
                return divide;
            }
            return new BigDecimal(0);
        }
    }

    @Data
    @ApiModel("QuaStatisticsVo - JmrsList")
    public static class JmrsList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
//        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        @ApiModelProperty("创建时间")
        private Date createTime;

        public boolean isFlag() {
            if (StrUtil.isNotEmpty(code) && "JMRS-Y".equals(code) && StrUtil.isNotEmpty(answer) && "是".equals(answer)) {
                return true;
            }
            return false;
        }
    }

    @Data
    @ApiModel("QuaStatisticsVo - DntResult")
    public static class DntResult {
        @ApiModelProperty("时间")
//        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date time;
        @ApiModelProperty("总数")
        private int total;
        @ApiModelProperty("≤45 min")
        private int dy45;
        @ApiModelProperty("≥45 min且≤60 min")
        private int dy60;
        @ApiModelProperty(">60 min")
        private int other;
        @ApiModelProperty("日期字符串")
        private String date;

        @ApiModelProperty("平均数")
        private BigDecimal average;
        @ApiModelProperty("中位数")
        private BigDecimal median;

        public Date getTime() {
            if (time != null) {
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                try {
                    return simpleDateFormat.parse(simpleDateFormat.format(new Date(time.getTime())));
                } catch (Exception e) {
                    return null;
                }
            }
            return null;
        }
    }

    @Data
    @ApiModel("QuaStatisticsVo - DntList")
    public static class DntList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date createTime;
        @ApiModelProperty("到院时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date dyrq;
        @ApiModelProperty("到达急诊时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date ddjzsj;
        @ApiModelProperty("溶栓开始时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date rskssj;

        private Long deptId;

        public Long getDnt() {
            if (rskssj == null) {
                return 0L;
            }
            if (dyrq != null) {
                return rskssj.getTime() - dyrq.getTime();
            }
            if (ddjzsj != null) {
                return rskssj.getTime() - ddjzsj.getTime();
            }
            return 0L;
        }
    }

    @Data
    @ApiModel("AmsHomeVo - BfzResult")
    public static class BfzResultVo {
        private int total;
        private int bfNum;
        private BigDecimal decimal;
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date date;
        private String time;


        public BigDecimal getDecimal() {
            if (total != 0) {
                BigDecimal divide = new BigDecimal(bfNum).divide(new BigDecimal(total), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
                return divide;
            }
            return new BigDecimal(0);
        }
    }

    @Data
    @ApiModel("AmsHomeVo - PatientResult")
    public static class BfzResult {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;
        @ApiModelProperty("到院时间")
        private Date dysj;
        @ApiModelProperty("到达急诊时间")
        private Date ddjzsj;
        @ApiModelProperty("溶栓开始时间")
        private Date rskssj;
    }

    @Data
    @ApiModel("AmsHomeVo - DntResult")
    public static class DptResult {
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date time = new Date();
        private int total;
        private int dy60;
        private int dy90;
        private int other;
        private String date;

    }

    @Data
    @ApiModel("AmsHomeVo - RptResult")
    public static class RptResult {
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date time;
        private int total;
        private int dy60;
        private int dy90;
        private int other;
        private String date;
    }

    @Data
    @ApiModel("AmsHomeVo - RptList")
    public static class RptList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;
        @ApiModelProperty("置鞘时间")
        private Date zqsj;
        @ApiModelProperty("血管再通时间")
        private Date xgztsj;

        public Long getRptTime() {
            if (xgztsj != null && zqsj != null) {
                return xgztsj.getTime() - zqsj.getTime();
            }
            return 0L;
        }
    }

    @Data
    @ApiModel("AmsHomeVo - OntList")
    public static class OntList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;
        @ApiModelProperty("发病时间")
        private Date fbsj;
        @ApiModelProperty("溶栓时间")
        private Date rssj;

        public Long getOntTime() {
            if (fbsj != null && rssj != null) {
                return rssj.getTime() - fbsj.getTime();
            }
            return 0L;
        }

    }

    @Data
    @ApiModel("AmsHomeVo - DntList")
    public static class DptList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;
        @ApiModelProperty("发病时间")
        private Date fbsj;
        @ApiModelProperty("置鞘时间")
        private Date zqsj;
        @ApiModelProperty("到院时间")
        private Date dysj;
        @ApiModelProperty("到达急诊时间")
        private Date ddzjsj;

        public Long getDptTime() {
            if ((dysj != null || ddzjsj != null) && zqsj != null) {
                return zqsj.getTime() - (ddzjsj == null ? dysj.getTime() : ddzjsj.getTime());
            }
            return 0L;
        }
    }

    @Data
    @ApiModel("AmsHomeVo - XgzlLvResult")
    public static class XgzlLvResult {
        private Date time;
        @ApiModelProperty("血管内治疗人数")
        private int gailv;
        @ApiModelProperty("患者总数")
        private int total;
        private String date;
        @ApiModelProperty("桥接人数")
        private int qjNmu;
        @ApiModelProperty("非桥接人数")
        private int fqjNum;

        public BigDecimal getDecimal() {
            if (total != 0) {
                return new BigDecimal(gailv).divide(new BigDecimal(total), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
            }
            return new BigDecimal(0);
        }
    }

    @Data
    @ApiModel("AmsHomeVo - XgzlLvList")
    public static class XgzlLvList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;

        public boolean isFlag() {
            if (StrUtil.isNotEmpty(code) && ZL_JRZT_EVT.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "是".equals(answer)) {
                return true;
            }
            return false;
        }
    }

    @Data
    @ApiModel("AmsHomeVo - NcxResult")
    public static class NcxResult {
        private Date time;
        private int gailv;
        private int total;
        private String date;

        private List<SsType> ssTypeList;

        public BigDecimal getDecimal() {
            if (total != 0) {
                BigDecimal divide = new BigDecimal(gailv).divide(new BigDecimal(total), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
                return divide;
            }
            return new BigDecimal(0);
        }

        @Data
        @ApiModel("AmsHomeVo - NcxResult - SsType")
        public static class SsType {
            @ApiModelProperty("手术类型")
            private String ssType;
            @ApiModelProperty("手术名称")
            private String ssName;
            @ApiModelProperty("总数")
            private int total;
        }
    }

    @Data
    @ApiModel("AmsHomeVo - NcxLvList")
    public static class NcxLvList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;
        @ApiModelProperty("住院日期")
        private Date zyrq;
        private String idCard;
        private Byte sex;

        public Integer getZyAge() {
            if (zyrq != null && StrUtil.isNotEmpty(idCard)) {
                Short yearByIdCard = IdcardUtil.getYearByIdCard(idCard);
                DateTime yyyy = DateUtil.parse(yearByIdCard + "", "yyyy");
                Calendar bef = Calendar.getInstance();
                Calendar aft = Calendar.getInstance();
                bef.setTime(yyyy);
                aft.setTime(zyrq);
                return aft.get(Calendar.YEAR) - bef.get(Calendar.YEAR);
            }
            return 0;
        }

        public boolean isFlag() {
            //治疗类型是脑出血 或者  脑出血是否在院
            if (StrUtil.isNotEmpty(code) && ((ZLLX_TYPE.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "3".equals(answer))
                    || (ZL_FBQK_NCX.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "是".equals(answer)))) {
                return true;
            }
            return false;
        }

        public boolean isNgsFlag() {
            //诊断编码为I63的是脑梗死
            if (StrUtil.isNotEmpty(code) && ((ZL_JBXX_ZDBM.getKey().equals(code) && StrUtil.isNotEmpty(answer) && answer.contains("I63")))) {
                return true;
            }
            return false;
        }

        public boolean isJmrsFlag() {
            //治疗类型是脑出血 或者  脑出血是否在院
            if (StrUtil.isNotEmpty(code) && ((JMRS_Y.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "是".equals(answer)))) {
                return true;
            }
            return false;
        }

    }

    @Data
    @ApiModel("AmsHomeVo - QsfxList")
    public static class QsfxList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;

        public boolean isNcxFlag() {
            //治疗类型是脑出血 或者  脑出血是否在院
            if (StrUtil.isNotEmpty(code) && ((ZLLX_TYPE.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "3".equals(answer))
                    || (ZL_FBQK_NCX.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "是".equals(answer)))) {
                return true;
            }
            return false;
        }

        public boolean isDieFlag() {
            //死亡
            if (StrUtil.isNotEmpty(code) && ((ZLLX_TYPE.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "3".equals(answer))
                    || (ZL_FBQK_NCX.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "是".equals(answer)))) {
                return true;
            }
            return false;
        }
    }

    @Data
    @ApiModel("趋势分析统计")
    public static class QsfxResult {

        private List<Child> childList;

        @Data
        @ApiModel("趋势分析统计 - Child")
        public static class Child {
            @ApiModelProperty("类型 (0:急性脑梗死静脉溶栓率; 1:DNT中位数; 2:DNT≤60分钟达标率; 3:ONT; 4:DPT中位数; 5:DPT≤90分钟达标率; 6:OPT;" +
                    " 7:静脉溶栓及血管治疗患者住院死亡率; 8:脑出血手术患者住院死亡率; 9:动脉瘤手术患者住院死亡率;)")
            private byte type;
            @ApiModelProperty("本院数据")
            private BigDecimal bysj;
            @ApiModelProperty("去年同期")
            private BigDecimal quntq;
            @ApiModelProperty("前年同期")
            private BigDecimal qntq;
            @ApiModelProperty("同比变化")
            private BigDecimal tbbh;
            @ApiModelProperty("上月数据")
            private BigDecimal sysj;
            @ApiModelProperty("环比变化")
            private BigDecimal hbbh;
        }
    }

    @Data
    @ApiModel("AmsHomeVo - XgzlLvList  急性脑出血患者康复治疗率")
    public static class JxncxhzkfzlLvList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;

        public boolean isFlag() {
            if (StrUtil.isNotEmpty(code) && ZL_JRZT_EVT.getKey().equals(code) && StrUtil.isNotEmpty(answer) && "是".equals(answer)) {
                return true;
            }
            return false;
        }
    }


    @Data
    @ApiModel("AmsHomeVo - NcxLvResult")
    public static class NcxLvResult {
        @ApiModelProperty("急性脑出血患者严重程度评估率 ")
        private BigDecimal jxncxpgl;
        @ApiModelProperty("急性脑出血患者康复治疗率")
        private BigDecimal jxncxkfzll;
        @ApiModelProperty("急性脑出血患者发病6 h内降压药物治疗率 ")
        private BigDecimal ywzll;
        @ApiModelProperty("脑出血患者住院7 d内潜在病因筛查率")
        private BigDecimal qzbyscl;
        @ApiModelProperty("抗凝相关脑出血患者抗凝逆转治疗率")
        private BigDecimal knnzzll;
        @ApiModelProperty("急性脑出血患者卒中相关肺炎筛查率")
        private BigDecimal fyscl;
        @ApiModelProperty("脑出血患者发病24 h内复查头颅CT等影像学检查率")
        private BigDecimal ctjcl;
        @ApiModelProperty("合并高血压的脑出血患者出院时降压药物治疗率")
        private BigDecimal jyywzll;
        @ApiModelProperty("脑出血患者入院48 h内深静脉血栓预防率")
        private BigDecimal sjmxsyfl;
        @ApiModelProperty("急性脑出血患者住院病死率")
        private BigDecimal zybsl;
        @ApiModelProperty("脑出血患者吞咽功能筛查率")
        private BigDecimal tygnscl;

    }

    @Data
    @ApiModel("AmsHomeVo - 病情评估与急性期检查")
    public static class BqpgResult {
        @ApiModelProperty("脑梗死患者神经功能缺损评估率 ")
        private BigDecimal jxncxpgl;
        @ApiModelProperty("发病24 h内脑梗死患者急诊就诊45 min内临床实验室检查完成率")
        private BigDecimal jxncxkfzll;
        @ApiModelProperty("发病24 h内脑梗死患者急诊就诊30 min内完成头颅CT影像学检查率 ")
        private BigDecimal ywzll;
        @ApiModelProperty("发病24 h内脑梗死患者血管内治疗术前影像学评估率")
        private BigDecimal qzbyscl;
    }

    @Data
    @ApiModel("AmsHomeVo - 急性期脑血管再灌注治疗能力")
    public static class JxnxgzgzzlnlResult {
        @ApiModelProperty("发病4.5 h内脑梗死患者静脉溶栓率 ")
        private BigDecimal ngsjmrsl;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗90 min内完成动脉穿刺率")
        private BigDecimal dmccl;
        @ApiModelProperty("静脉溶栓的脑梗死患者到院到给药时间＜60 min的比例 ")
        private BigDecimal jmrsngsdydgysj;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗60 min内成功再灌注率")
        private BigDecimal ngszgzl;
        @ApiModelProperty("发病6 h内前循环大血管闭塞性脑梗死患者血管内治疗率")
        private BigDecimal qdxhbsxngsxgnzll;
        @ApiModelProperty("发病24 h内脑梗死患者血管内治疗率")
        private BigDecimal ngshzxgnzll;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗术后即刻再通率")
        private BigDecimal ngsxgzlhjkztl;
    }


    @Data
    @ApiModel("AmsHomeVo - 规范化治疗与预防并发症")
    public static class Gfhzlyyfbfz {
        @ApiModelProperty("脑梗死患者入院48 h内抗血小板药物治疗率 ")
        private BigDecimal kxxbywzll;
        @ApiModelProperty("住院期间合并心房颤动的脑梗死患者抗凝治疗率")
        private BigDecimal knzll;
        @ApiModelProperty("非致残性脑梗死患者发病24 h内双重强化抗血小板药物治疗率 ")
        private BigDecimal scqhkxxbywzll;
        @ApiModelProperty("脑梗死患者吞咽功能筛查率")
        private BigDecimal ngstygnscl;
        @ApiModelProperty("不能自行行走的脑梗死患者入院48 h内深静脉血栓预防率")
        private BigDecimal sjmxsyfl;
        @ApiModelProperty("脑梗死患者康复评估率")
        private BigDecimal kfpgl;
        @ApiModelProperty("脑梗死患者住院7 d内血管评价率")
        private BigDecimal xgpjl;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗术中新发部位栓塞发生率")
        private BigDecimal ssfsl;
        @ApiModelProperty("住院期间脑梗死患者他汀类药物治疗率")
        private BigDecimal ttlywzll;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗术后症状性颅内出血发生率")
        private BigDecimal cxfsl;
    }

    @Data
    @ApiModel("AmsHomeVo - 二级预防")
    public static class Ejyf {
        @ApiModelProperty("出院时脑梗死患者抗栓治疗率 ")
        private BigDecimal kxszll;
        @ApiModelProperty("出院时合并糖尿病的脑梗死患者降糖药物治疗率")
        private BigDecimal jtywzll;
        @ApiModelProperty("出院时脑梗死患者他汀类药物治疗率 ")
        private BigDecimal cyhzttywzll;
        @ApiModelProperty("出院时合并心房颤动的脑梗死患者抗凝治疗率")
        private BigDecimal knzll;
        @ApiModelProperty("出院时合并高血压的脑梗死患者降压治疗率")
        private BigDecimal jyzll;
    }

    @Data
    @ApiModel("AmsHomeVo - 结局指标")
    public static class Jjzb {
        @ApiModelProperty("脑梗死患者住院死亡率 ")
        private BigDecimal zyswl;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗术后住院期间死亡率")
        private BigDecimal zyqjswl;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗术后90 d mRS评估率 ")
        private BigDecimal xgnzlpgl;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗术后90 d死亡率")
        private BigDecimal xgnzlswl;
        @ApiModelProperty("发病24 h内脑梗死患者行血管内治疗术后90 d良好神经功能预后率")
        private BigDecimal sjgnyhl;
    }

    @Data
    @ApiModel("AmsHomeVo - 脑梗死")
    public static class NgsReslut {
        @ApiModelProperty("病情评估与急性期检查")
        private BqpgResult bqpgResult;
        @ApiModelProperty("急性期脑血管再灌注治疗能力")
        private JxnxgzgzzlnlResult jxnxgzgzzlnlResult;
        @ApiModelProperty("规范化治疗与预防并发症")
        private Gfhzlyyfbfz gfhzlyyfbfz;
        @ApiModelProperty("二级预防")
        private Ejyf ejyf;
        @ApiModelProperty("结局指标")
        private Jjzb jjzb;
    }

    @Data
    @ApiModel("AmsHomeVo - ONT")
    public static class OntReslut {
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("X轴时间")
        private String xTime;
        @ApiModelProperty("数量")
        private Integer num;
        @ApiModelProperty("平均数")
        private BigDecimal average;
        @ApiModelProperty("中位数")
        private BigDecimal median;
    }

    @Data
    @ApiModel("AmsHomeVo - CEA/CAS")
    public static class CeaReslut {
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("X轴时间")
        private String xTime;
        @ApiModelProperty("概率")
        private BigDecimal total;
        @ApiModelProperty("标准式CEA")
        private Integer bzs;
        @ApiModelProperty("外翻式CEA")
        private Integer wfs;
        @ApiModelProperty("CAS")
        private Integer cas;
        @ApiModelProperty("复合手术")
        private Integer fhss;
    }

    @Data
    @ApiModel("AmsHomeVo - LndmlReslut")
    public static class LndmlReslut {
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("X轴时间")
        private String xTime;
        @ApiModelProperty("概率")
        private BigDecimal total;
        @ApiModelProperty("接入栓塞术")
        private Integer jrsss;
        @ApiModelProperty("闭夹术")
        private Integer bjs;
        @ApiModelProperty("复合手术")
        private Integer fhss;
    }

    @Data
    @ApiModel("AmsHomeVo - OptList")
    public static class OptList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;
        @ApiModelProperty("发病时间")
        private Date fbsj;
        @ApiModelProperty("溶栓时间")
        private Date xgztzj;

        public Long getOptTime() {
            if (fbsj != null && xgztzj != null) {
                return xgztzj.getTime() - fbsj.getTime();
            }
            return 0L;
        }
    }

    @Data
    @ApiModel("AmsHomeVo - OptReslut")
    public static class OptReslut {
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("X轴时间")
        private String xTime;
        @ApiModelProperty("数量")
        private Integer num;
        @ApiModelProperty("平均数")
        private BigDecimal average;
        @ApiModelProperty("中位数")
        private BigDecimal median;
    }
}
